package com.fzdy.dataplatform.entity;

import com.alibaba.fastjson.annotation.JSONField;

import javax.persistence.*;
import java.util.Date;

@Entity
@Table(name = "ktv")
public class KTV {
    private Integer id;
    private String name;
    private Integer K;
    private String memo;
    private Date createdate;
    private Integer tid;
    private Integer share;
    private Integer userid;

//    @Transient
//    private Integer uid;

    @JSONField(serialize = false)
    private TType tType;

    public KTV() {
    }

    public KTV(String name, Integer k, String memo, Date createdate, Integer tid) {
        this.name = name;
        K = k;
        this.memo = memo;
        this.createdate = createdate;
        this.tid = tid;
    }

    @Id
    @Column(name = "id", nullable = false)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    @Column(name = "name")
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Column(name = "k")
    public Integer getK() {
        return K;
    }

    public void setK(Integer k) {
        K = k;
    }

    @Column(name = "tid")
    public Integer getTid() {
        return tid;
    }

    public void setTid(Integer tid) {
        this.tid = tid;
    }

    @Column(name = "memo")
    public String getMemo() {
        return memo;
    }

    public void setMemo(String memo) {
        this.memo = memo;
    }

    @Column(name = "createdate")
    public Date getCreatedate() {
        return createdate;
    }

    public void setCreatedate(Date createdate) {
        this.createdate = createdate;
    }


    @ManyToOne
    @JoinColumn(name = "tid", referencedColumnName = "id", foreignKey = @ForeignKey(name = "ktv_ibfk_1"), insertable = false, updatable = false)
    public TType gettType() {
        return tType;
    }

    public void settType(TType tType) {
        this.tType = tType;
    }

    public Integer getShare() {
        return share;
    }

    public void setShare(Integer share) {
        this.share = share;
    }

    public Integer getUserid() {
        return userid;
    }

    public void setUserid(Integer userid) {
        this.userid = userid;
    }


}
